<template>
  <div id="app">
    <text-document
      :title="doc.title"
      @update:title="doc.title = $event"
    ></text-document>

    <text-document :title.sync="doc.title"></text-document>
    <!-- 事件名称 “update:title” -->
    <!-- 事件名称 “click” -->
    <!-- 事件名称 “change” -->
  </div>
</template>
<script>
import TextDocument from "@/components/TextDocument.vue";
export default {
  data() {
    return {
      doc: {
        title: "父组件的标题",
      },
    };
  },
  components: { TextDocument },
};
</script>
<style lang="scss"></style>
